// view/my/diancan/baobmingx/baobmingx.js
let app = getApp()
let yuming = app.globalData.yuming
Page({
  /**
   * 页面的初始数据
   */
  data: {
    yuming: yuming,
    huan: [],
    currtab: 0,
    heights: '',
    title: "",
    state: 0, //0 营收统计  1 明细
    date: '', //开始
    endtime:'2019-06-30',
    hangs:[{},{},{},{},{},{},{},{},{},{}],
  },
  _bindpreDay(e) {
    let { year, month,day } = e.detail;
    // this.getDoctorList(year, month);
  },
  _bindnextDay(e) {
    let { year, month,day } = e.detail;
    // this.getDoctorList(year, month);
  },
  // 选择开始时间
  bindDateChange: function (e) {
    this.setData({
      date: e.detail.value,
      starTime: e.detail.value
    })
  },
  // 切换
  qies(e) {
    var index = e.currentTarget.dataset.currtab
    this.setData({
      currtab: index,
      qiyebian: 0
    })
  },
  backs() {
    wx.navigateBack({
      delta: 1
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var test = new Date();
    var year = test.getFullYear();
    var month = test.getMonth() + 1
    var ri = test.getDate()
    this.setData({
      heights: wx.getMenuButtonBoundingClientRect().top + 5,
      title: options.title,
      // date: year + "-" + month + "-" + ri,
      state:options.state
    })
    if (this.data.state == 0) {
      this.setData({
        huan: ['日报', '月报']
      })
    }
    if (this.data.state == 1) {
      this.setData({
        huan: ['日账单', '月账单']
      })
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },
})